import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsNotEmpty, IsNumber, IsOptional } from 'class-validator';

export class CreateVideoDto {
  @IsString()
  @IsNotEmpty()
  @ApiProperty()
  title: string;

  @IsString()
  @ApiProperty()
  description: string;

  @IsString()
  @IsNotEmpty()
  @ApiProperty()
  ossVideoKey: string; // 前端直传后返回的OSS文件Key

  @IsString()
  @IsNotEmpty()
  @ApiProperty()
  ossCoverKey: string; // 前端直传后返回的OSS文件Key

  @IsNumber()
  @IsNotEmpty()
  @ApiProperty({
    description: '视频分类ID',
    example: 1
  })
  categoryId: number;

  @IsNumber()
  @IsOptional()
  @ApiProperty({
    description: '视频时长（以秒为单位）',
    example: 120,
    required: false
  })
  duration?: number;
}
